Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
@lerna/run-lifecycle
Advanced tools
@lerna/run-lifecycle is a package that allows you to run lifecycle scripts for npm packages within a Lerna-managed monorepo. It helps in executing pre-defined scripts like preinstall, install, postinstall, prepublish, publish, postpublish, etc., across multiple packages in a monorepo setup.
Run Predefined Lifecycle Scripts
This feature allows you to run predefined lifecycle scripts like preinstall, install, postinstall, etc., for a given package. The code sample demonstrates how to run the 'preinstall' script for a package.
const { runLifecycle } = require('@lerna/run-lifecycle');
async function runScript(pkg, script) {
await runLifecycle(pkg, script, {
stdio: 'inherit',
});
}
const pkg = { name: 'my-package', location: '/path/to/package' };
runScript(pkg, 'preinstall');
Custom Script Execution
This feature allows you to run custom scripts defined in the package.json of a given package. The code sample demonstrates how to run a custom script named 'custom-script' for a package.
const { runLifecycle } = require('@lerna/run-lifecycle');
async function runCustomScript(pkg, script) {
await runLifecycle(pkg, script, {
stdio: 'inherit',
scriptShell: '/bin/bash',
});
}
const pkg = { name: 'my-package', location: '/path/to/package' };
runCustomScript(pkg, 'custom-script');
npm-lifecycle is a package that provides the functionality to run lifecycle scripts for npm packages. It is similar to @lerna/run-lifecycle but is not specifically designed for monorepo setups managed by Lerna. It can be used for individual npm packages.
Yarn is a package manager that also supports running lifecycle scripts for packages. While it is not a direct replacement for @lerna/run-lifecycle, it provides similar functionalities in terms of script execution and can be used in monorepo setups with Yarn Workspaces.
pnpm is another package manager that supports running lifecycle scripts. It is known for its efficient handling of node_modules and can be used in monorepo setups. Like Yarn, it provides similar functionalities but is not specifically tailored for Lerna-managed monorepos.
@lerna/run-lifecycle
An internal Lerna tool
You probably shouldn't, at least directly.
Install lerna for access to the lerna
CLI.
3.16.2 (2019-07-22)
npm-lifecycle@^3.1.2
(25edebf), closes #2189@zkochan/cmd-shim
(60d1100)FAQs
An internal Lerna tool
The npm package @lerna/run-lifecycle receives a total of 177,083 weekly downloads. As such, @lerna/run-lifecycle popularity was classified as popular.
We found that @lerna/run-lifecycle demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.